All Questions
10 questions
1vote
0answers
28views
How to integrate my HTML and javascript into my child theme
I have a javascript script, html, and css I put together on JSfiddle that I now need to essentially put on a page in wordpress. I'm using a child of the generatePress theme. I'm doing it this way ...
0votes
0answers
93views
Enqueue CSS and Script only if needeed
How can I enqueue a CSS code only on the pages which use that CSS? Usually it's quite easy to know if a particular CSS or JS is used on a WordPress Post: it's enough to check if the shortcode is used ...
0votes
1answer
995views
enqueing Javascript and CSS
Whenever I check my website on gtmetric, google Insights, Pingdom etc... I always get feed back of render blocking JS Currently I enqueue all my scripts as so: <head> <link rel="...
3votes
3answers
3kviews
Relative path instead of absolute for wp_enqueue_script
When you enqueue scripts or styles with the following: function themeslug_enqueue_style() { wp_enqueue_style( 'core', '/style.css', false ); } add_action( 'wp_enqueue_scripts', '...
1vote
1answer
2kviews
How to insert html/css/javascript code to wordpress plugin
I'm trying to show a modal dialog when user get registered (action_hook: user_register) using the woocommerce plugin, but without having any result. I would appreciate any help! The code is shown ...
0votes
1answer
47views
Theme JS is available but theme CSS isn't
In functions.php I used the following code to enqueue assets, but for some reason all CSS is ignored (JS isn't ingonred): function my_theme_enqueue_assets() { wp_enqueue_style( 'parent-style', ...
0votes
1answer
752views
Custom Plugin - CSS works, JS doesn't
In the plugin I'm making, I use separate js and css files (____.js, ____.css). This is the first time that I've included an external .js file in anything. I'm registering and enqueueing both in the ...
4votes
1answer
2kviews
How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?
How would I go about combining multiple CSS files and concatenating my scripts if they're being enqueued as WordPress recommends? My site is pretty slow and would like to optimize for performance.
10votes
1answer
9kviews
wp_enqueue_scripts, wp_register_scripts, wp_print_scripts: i'm confused
I've been reading up a bit on this subject, but the more I read - the more confused I get. Can someone explain to me in short what's the exact difference between wp_enqueue_scripts, ...
28votes
4answers
3kviews
Could the WP script/style loader be used to concatenate and gzip scripts and styles in the front-end?
WP has a nice javascript loader included in wp-admin: http://core.trac.wordpress.org/browser/tags/3.0.4/wp-admin/load-scripts.php and a CSS loader: http://core.trac.wordpress.org/browser/tags/3.0.4/...